move repeated code to partial