code structure amended: DAO layer extracted