Fixed typo (ressource -> resource) and refactored all code accordingly.