optimized line functions