Refactor and add video support