I think this can be done cleaner