refactored solution and added reflection