Improved code style and readability