Refactored + moved changes to appropriate modules