Cleaned up among SQL's not used and better grouping