[WORKING] Refactoring code.