Reorganizing code snippets to fit