cleaning up some code snippets