Refactored Controller and DAO class