Make prettier
Extract more functions, rename stuff