Split implementation and tests