split functionality from testing