moved refactored code into its own directory