refatoring to specs