refactor source, change name of some variables