added constants, logger and localStorage manipulation