loop and byte clean up