refactoring
big cleanup