On second thought, a cleaner way of achieving the same thing