Tried to make things a little more generic.