fix and refactor YT integration