Moved background code to new file