Trying to clean up contents code