And another refactor, now a lot easier to read and a lot more uselessly micro-optimized :P