clean up dostuff to make it more readable