Implemented support for and switched to runtime variables instead of defines