Small refactor.
Extracted utilities and changed some class names.