More refactoring to get rid of warnings