We can do this more elegantly with ruby