Reduced redundant code, added new crypto test