split code and tests