Factoring out magic numbers and commenting pass.