removed compliment to if-else statement
refactored for removing magic numbers and Replacing compound conditionals