small refactoring & code clean up