refactoring, ref issue #3