everything works. time for refactor