Refactoring

- simplified logic
- removed Future wrap (always can do that in action)
- more functional style
- code style corrections