Refactor lookup && add functions