Fix previous refactoring issues