Refactoring to make the usage of the API handy + cleanup efforts.