cleaned up code snippets