Modulize code and extract AES CryptoJs integration