added database class and layout/view structure