Cleaned up untidy macro.