restructure and reafctor