Refactoring mds project