Refactor: migrated modal plugin to classes