DRY-ed lookups controller a bit

- refactored controller
- fixed bug