Refactored angle calculations to a single class (Direction).