Refactor

Merging master and refactor