optimised device a little to avoid to much mapping over lines data structure