maybe someone can suggest a cleaner way of doing this?