Refactors into partials and adds edit and delete functionality