restructure and new code