refactoring to make only one direction call