better handle of multiple elements in same line