moving code to appropriate partials