internalized some private functions into Jp2k class methods