Optimizing If-Else Statements for best performance