Some more code improvements