Fixed previous refactor mistakes