Changed quite a bit to the existing structure
Fixed the merge conflicts