add comment, refactor a bit