refactor selection lib

easy