refactoring by adding marionette library