move entities and database service to commons