Added initial check for content. More refactoring.