refactor + comments