Moved background function to it's own file.