Remove unused private method and fix warnings