I think there are cleaner ways to do this withour using xpath and such.