Move code to projects and project class