Minor refactor of Pythagorean methods