Refactoring of Controller logic into handlers and actions