DAO pattern implementation

Related to issue #7