- reorganized code