Fixed indentation
Refactored methods to use case statement instead of large if statements