Refactored thanks to @martin-g's feedback

https://github.com/skinny-framework/skinny-framework/pull/118