restructure selection api