some comments + refactor