Trying to refactor the damn code to remove cyclic references