refactored 'contents' var