Slight refactor, removed some old code that wasn't used anymore