De-janked code by removing magic numbers