Refactoring made by our friend Pryz