issue #1 - refactored