Refactored:
random magic const -> constant variables
static inline functions -> namespace { inline functions }