refactoring some stuff, still no tests, but Im gonna make it!