Fixed problem with refactor