refactoring and code clean up
refactoring and code clean up