Revert "rewriting bimap representation functions"

This reverts commit c91b749e7b546bc3f452865c9ce1452953774d5c.