Refactored a but line dashed mode and added tests for it