More functionality & refactor