Some refactoring changes