Some refactoring into more meaningful files