refactoring raypicking