refactor methods, fix typos