Cleaning up code for video