refactoring & enhancements