code effeciency improvements