restructure and further work on declarations