Refactored the p2-profile-gen for versions