more code improvements