Move creds and helpers out to separate files