Adding constants and removing unnecessary code blocks