Refactoring, simplifying, PSR code style update, hotfix for sanitizing post data