Moved things out of main file