some refactorings to the nancy sample application