refactor loc