Added style guide and some refactoring