code clean up. Trying to increase performance