Some refactoring'