refactoring expiration changes as per peer reviews

These changes are for the review comments on https://github.com/wso2-dev/andes/pull/20/