embed refactor