Tweaked code snippets