[CHORE] Move env variables to config.
[CHORE] Refactor controllers to separate lib.