Refractor Derpy Code

I refractored the old code from ID Tech Camps, so things should be less
derpy.