Refactored variables code