sligh refactor