code cleanup and standardisation, timeout is now mandatory