Refactor/comment source code