Make needlessly global functions static
Constify numeric constants