refactor render js, add tools