General improvements to implementation