Refactor edit and new to partial