added content detection
refactor content detection