reorganized, renamed and cleaned up