better scoping and externalizing magic values