Fixes of the refactor