Simplified some macros
Merge branch 'dev' into ms