major refactor (halloween clean)