reorganized java for new ui