moving code to partials