Refactor to work with new versions of slim.