cleaned up db model and added click analytics