Moved contents code to helpers