Restructure and cleanup