added some wrappers for system and improved system macros