refactor controller; extract methods to DAO

Alberto Saavedra & Louis Knapp