Style fixes and performance improvement