big cleanup and refactor