Replace some hard coded constants with preprocessor definitions for clarity