Implemented eager loading to reduce the number of SQL queries