add data access layer
delete dead code