Refactor to remove some warnings!