add better structure for spec code