Refactored queries, working. Still need some adjustments