add util for packing response
rename functions and remove unused stuff