Seperating the systematic API, improving the generic API and adding unit tests