initial import of the refactored code