cleans up some code and adds support to direct inbox and major and minor