Preparing for some rewrite

Changes in plans, some code has to be rewritten.