refactor allocate
add share object