Refactoring to comply with API version 10.