Move parsing to separate module.
Refactor querying.