Refactored codebase to use partials