Fixed code style and optimized using