restructure and update to tests