Refactored using if/else
Initial commit