fixes, refactoring and some code skeletons added