reorganized some code