Move code for extracting installed package version to utils