refactor a little bit, add some new modes