refactoring and cleanup
refactoring and cleanup