Refactored code category reformatting, simplified variables a bit