mas refactoring