now initial data works well + some cleanups and refactoring