PEP8 formatted
switched to resource-based model