remove old code
cleanup and refactoring