Move to window/utils

Signed-off-by: Alexey Gladkov <gladkov.alexey@gmail.com>
Move content type detection to separate function

Signed-off-by: Alexey Gladkov <gladkov.alexey@gmail.com>
Always return valid channel

Signed-off-by: Alexey Gladkov <gladkov.alexey@gmail.com>