refactored delegate
reorganized files