Moved types and global variables out of main.go