refactor done

TODO : improve performance