Additional methods, ported from another solution.