Remove unneeded macros and begin making code more portable