This method seems to have more than one responsibility - figure out if component should embedded and then it sets value of private property this.embedded. I think it would be more elegant, to have it split - to method like shouldBeEmbeded() etc, and outside of that method doing something with that information.