Refactoring for flexibility

* A number can be passed in