cleaned code and restructured testructureda