Reducing number of database accesses to improve the app speed and modularized some classes.