Merging module refactoring into master