add plugins folder
refactor functions for reusability
fix merge conflict