Moved the commonlib check in a separate file