removed views and tried to do things in single query