added some cleaner code snippets

added some snippets that might be useful to start cleaning up code