Moved metadata manipulating functions to seperate file