framework for line fitting