[refactor] Internal refactor, so I can understand the code