Refactoring

Code looks cleaner now