Use enum instead of magic numbers