Have you thought of using a proc to clean this up a bit?