Refactoring, removing warnings