Refactors config into method
Adds logic & test for add_line