Reviewed and improved coding style