Minor code cleanup
Move generic entity editing logic to a separate module to be used as a base for more speciofic views