use "within-element" module to simplify code

Now it's nice and semantic and stuff :)