model refactoring and DAO Implementation