refactored
before big change
working for single payload
working v1