Separating files and adding more functionality