Misc cleanup of controller, model, and template