REFACTOR: improve functions by kobi