refactoring  line drawer