Cleanup

@Naosyth A bunch of minor code cleanup stuff