Refactored some global defines