added style and performance fixes