mshah - refactoring