Split code and tests