Enhancement/refactoring pt 2