Doesn't compile yet, but there's a much better way to do this...