MDS: Organize code to keep pattern