complete refactoring of project to have the query executed only on request and being as modular as possible