code cleanup, refactoring Directions