refactor asteroids sample