Solve e1.18 + move helper funcs to separate file.