re organizing code