completed refactoring and reflections