Refactor: add addVersion() function