bug found - refactoring