Started to refactor