Minor variable changes, refactor