install bullet gem; refactoring queries