refactor upload part, not finished