removed macro code and converted to static method