I know you're just moving this but I wonder if it makes sense to make this into a directive as there is one other use of it.  I'm fine waiting until a third use though.