restructure prototype