A more safe way to store weights