Code and tests cleanup #2