Reorganize some things, make timing more accurate