Improvements to cpu cicles (ideas taken from several unaccepted PR's to origin)