Code clean up for readability and efficiency

Removed unnecessary if, else, if else codes, added return after all
send redirect to make sure the method exits...