Little refactoring and merging