Refactor, clean, more comments