Working on refactor