Added initial stuff
Some refactorings