Working again with refactored coode