refactor meteor sample