move system libs calculation to its own file