organized some code