Last great refactor

Signed-off-by: LordIllyohs <lordillyohs@gmail.com>