refactored call handlers

added integration tests