Attempt at better line opening functions'