Works after big code refactor.