adding proper models and database layer