Refactoring dao, changed architecture

Signed-off-by: Victor Zagnitko <victor.zagnitko@yandex.ru>