Refactor to not use $- variable