Internal code files reorganization; improved testing