style changes and optimization