change long to int for some contants
rename expires to expiry