Cleaned up code for better readability