Move vault logic into class. Test the said class.