Refactoring.
Fix bug in validation.
Add promises fallback.