Code cleanup: Moved related functions from Types class to Environments and Vectors classes