reverted most of refactoring