Re-factor crypto service and update kodex.