Starting to add interfaces and cleaning code