Did some refactoring
commited left overs