Tried to make things a bit easier to read by adding in a helper class