A lot of more code improvements