further refactoring on 'astro.js'