major refactoring and I am not done