some refactoring, added helper module for plateau