Move functions to another file, update logic to get test pe builds