The views and queries are getting out of hand. So a refactor is probably necessary that follows the following patterns https://github.com/octoenergy/conventions/blob/master/patterns.md