Minor refactor of the problem