remove redundant code and update docs