Separated UI and Libs. Added db connectivity