Refactor View Controller code to allow for variable rest time