better way of doing this migration