Refactored code for variables etc.