Calculate sizes instead of using constants.