refactored directions into direction class