Some refactoring)