Refactor slightly to allow additional usecases more easily