added a firebase plugin and some refactoring