Cleanup and refactor assets page functions