began writing helpers and reorganizing code