Performance and Refactor

See readme and attached doc file.