added templating, editHandler and modified viewHandler