Pull more attributes and refactor attribute code