Done, but seems a bit over-engineered :/