constantize some magic numbers, and s/dir/direction