Todo: change compile time global constants to runtime-initialized globals