code rewrite, easier to follow and manage, reeks a lot less now