Cleaned up code for task :snap.