DRY out direction setting code

Signed-off-by: Rick Waldron <waldron.rick@gmail.com>