little cleanup and standardised the internval parameter