some code cleaning with handling response from server